fix(agent): make publication source names and modes stable - #312
Closed
schickling wants to merge 1 commit into
Closed
fix(agent): make publication source names and modes stable#312schickling wants to merge 1 commit into
schickling wants to merge 1 commit into
Conversation
schickling
force-pushed
the
schickling/2026-08-22-agent-publish-source-mode
branch
2 times, most recently
from
August 23, 2026 09:37
f29ded5 to
030b022
Compare
schickling
changed the base branch from
main
to
schickling/2026-08-21-resource-reference-envelope
August 23, 2026 09:37
schickling
force-pushed
the
schickling/2026-08-22-agent-publish-source-mode
branch
from
August 23, 2026 10:31
030b022 to
d53e1fd
Compare
schickling
changed the base branch from
schickling/2026-08-21-resource-reference-envelope
to
schickling/2026-08-22-resource-envelope-opencode-ding
August 23, 2026 10:32
schickling
force-pushed
the
schickling/2026-08-22-agent-publish-source-mode
branch
from
August 23, 2026 14:37
d53e1fd to
1a8f400
Compare
schickling
changed the base branch from
schickling/2026-08-22-resource-envelope-opencode-ding
to
main
August 23, 2026 14:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
st2 agent digest/publish --specrejects strictly valid one-Agent KDL when the source path does not end in.kdl, even though source filenames are staging details. Publication also replaces readableagent.kdltargets with the temporary file's0600mode.Goal
Accept spec sources based on captured bytes and strict declaration parsing, preserve an existing declaration's accepted mode on replacement, and create new declarations with the catalog's canonical readable
0644mode.Decisions
0644for creation, matching catalog projection and declaration-authoring behavior rather than inheriting the publisher's umask or source mode.Verification
./repro.shagainst4629aebd1a357652a7fdbe69935bf8aae1afd67ddeterministically reproduced both defects.0600before the change and now uses0644under umask0077;0600before the change and now preserves a distinct accepted0640target mode; the public repro covers the original0644regression.nix develop -c cargo test --test agent_publish spec_source_filename_is_not_semantic_after_strict_parsing -- --exact: 1 passed.nix develop -c cargo test --test agent_publish spec_creation_uses_the_canonical_readable_declaration_mode -- --exact: 1 passed.nix develop -c cargo test --test agent_publish spec_replacement_preserves_the_accepted_target_mode -- --exact: 1 passed.nix develop -c cargo test --workspace --lib --bins: 369 passed.nix develop -c cargo fmt --all -- --check: passed.nix build .#default: passed.git range-diffreports the pre-restack and post-restack publication commits as patch-identical.Exact verified base:
e282a7e732217fd3f5cfaa60095b558b248d2ca7.Exact verified head:
1a8f4009b4c9a85e37cdb035463959494ede8628.Complexity
No new public abstraction. One private value binds existing declaration bytes and mode captured from the same no-follow file handle.
Concerns
Replacement intentionally preserves the accepted target's complete permission bits. Creation always normalizes to
0644; source-file permissions remain non-semantic.Friction & bottlenecks
Follow-ups
None.
References
Closes #155.
Closes #311.
Former prerequisites #307 and #313 are merged in the exact base.
Downstream tracking: https://github.com/schickling/dotfiles/pull/1902